//
//  SystemMessageCell.m
//  ForestPack
//
//  Created by 郑洲 on 2018/7/5.
//  Copyright © 2018年 郑洲. All rights reserved.
//

#import "SystemMessageCell.h"

@interface SystemMessageCell ()

@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UIView *bgView;
@property (nonatomic, strong) UILabel *detailLabel;
@property (nonatomic, strong) UILabel *timeLabel;

@end

@implementation SystemMessageCell

+ (SystemMessageCell *)cellWithTableView:(UITableView *)tableView andIndexPath:(NSIndexPath *)indexPath{
    static NSString *cellID = @"SystemMessageCell";
    SystemMessageCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (cell == nil) {
        cell = [[SystemMessageCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        cell.backgroundColor = [UIColor whiteColor];
        [cell createSubView];
    }
    
    return cell;
}

- (void)createSubView {
    self.timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, ScreenX375(40))];
    self.timeLabel.textColor = REXADECIMALCOLOR(@"#666666");
    self.timeLabel.font = Kfont(12);
    self.timeLabel.textAlignment = NSTextAlignmentCenter;
    self.timeLabel.text = @"2018-05-25  15:40:50";
    [self addSubview:self.timeLabel];
    
    self.bgView = [[UIView alloc] initWithFrame:CGRectMake(ScreenX375(13), ScreenX375(40), SCREEN_WIDTH - ScreenX375(26), ScreenX375(84))];
    self.bgView.layer.cornerRadius = ScreenX375(5);
    self.bgView.layer.borderColor = LineColor.CGColor;
    self.bgView.layer.borderWidth = 0.5;
    self.bgView.clipsToBounds = YES;
    [self addSubview:self.bgView];
    
    self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(ScreenX375(29), ScreenX375(55), ScreenX375(220), ScreenX375(16))];
    self.titleLabel.textColor = REXADECIMALCOLOR(@"#333333");
    self.titleLabel.font = Kfont(14);
    self.titleLabel.text = @"我需要包装设计";
    [self addSubview:self.titleLabel];
    
    self.detailLabel = [[UILabel alloc] initWithFrame:CGRectMake(ScreenX375(29), ScreenX375(75), SCREEN_WIDTH - ScreenX375(58), ScreenX375(32))];
    self.detailLabel.textColor = REXADECIMALCOLOR(@"#666666");
    self.detailLabel.font = Kfont(12);
    self.detailLabel.numberOfLines = 0;
    self.detailLabel.text = @"消息消息消息消息消息消息消息消息消息消息消息消息消息消息消息消息消息消息消息消息";
    [self addSubview:self.detailLabel];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
